<template>
  <div class="container">
    <h1 class="page-title">组件案例展示</h1>
    
    <!-- LeeUI 案例区域 -->
    <div class="component-group">
      <h2 class="group-title">
        <span class="icon-wrapper">
          <i class="el-icon-s-flag"></i>
        </span>
        LeeUI 案例
      </h2>
      <div class="button-grid">
        <ElButton 
          @click="onJump('leeui-form')" 
          class="custom-button"
          type="primary"
        >
          表单 Form
        </ElButton>
        <ElButton 
          @click="onJump('leeui-table')" 
          class="custom-button"
          type="primary"
        >
          表格 Table
        </ElButton>
        <ElButton 
          @click="onJump('leeui-com')" 
          class="custom-button"
          type="primary"
        >
          单个组件 Com
        </ElButton>
      </div>
    </div>
    
    <!-- Element 案例区域 -->
    <div class="component-group">
      <h2 class="group-title">
        <span class="icon-wrapper">
          <i class="el-icon-s-tools"></i>
        </span>
        Element 案例
      </h2>
      <div class="button-grid">
        <ElButton 
          @click="onJump('element-form')" 
          class="custom-button"
          type="success"
        >
          表单 Form
        </ElButton>
        <ElButton 
          @click="onJump('element-table')" 
          class="custom-button"
          type="success"
        >
          表格 Table
        </ElButton>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ElButton } from 'element-plus'
import { useRouter } from 'vue-router'
const router = useRouter()

/**
 * 跳转
 * @param {string} name 跳转地址
 */
const onJump = (name: string) => {
  router.push({ name })
}
</script>

<style scoped>
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.page-title {
  text-align: center;
  color: #333;
  margin-bottom: 2.5rem;
  font-weight: 600;
  font-size: 2rem;
  position: relative;
  padding-bottom: 0.8rem;
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #409eff, #67c23a);
  border-radius: 2px;
}

.component-group {
  background-color: #fff;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.component-group:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.group-title {
  color: #1f2329;
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  font-weight: 500;
}

.icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 12px;
  background-color: #f0f7ff;
  color: #409eff;
}

.component-group:nth-of-type(2) .icon-wrapper {
  background-color: #f0fff4;
  color: #67c23a;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.custom-button {
  width: 100%;
  height: 60px;
  font-size: 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
}

.custom-button:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2);
}

.component-group:nth-of-type(2) .custom-button:hover {
  box-shadow: 0 4px 12px rgba(103, 194, 58, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .page-title {
    font-size: 1.6rem;
  }
  
  .component-group {
    padding: 1.5rem;
  }
  
  .button-grid {
    grid-template-columns: 1fr;
  }
}
</style>